package com.xncoding.freemarker.filter;

import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
//@Component
//@WebFilter(filterName = "apiLogFilter", urlPatterns = "/*")
//@Order(1)
public class ApiLogFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
                         FilterChain filterChain) throws IOException, ServletException {

        HttpServletRequest request = (HttpServletRequest) servletRequest;

        filterChain.doFilter(servletRequest, servletResponse);
//        filterChain.doFilter(new BodyHttpServletRequestWrapper((HttpServletRequest)servletRequest), servletResponse);

    }

    @Override
    public void destroy() {

    }


}
